<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>


        var a = [78,98,99,88,33,66];
        sort(a);
        console.log(a.toString());

        // 从小到大排序
        function sort(array){
            for (let i = 0; i < array.length; i++){
                for (let j = 0; j < array.length - i - 1; j++){
                    if (array[j] > array[j + 1]){
                        let t = array[j];
                        array[j] = array[j + 1];
                        array[j + 1] = t;
                    }
                }
            }
        }
    </script>
</body>
</html>